﻿using TI_BLE_HCI_ClientLib.BaseEntities;
using TI_BLE_HCI_ClientLib.GenericHCIEntities;
using TI_BLE_HCI_ClientLib.HCIBaseEntities;

namespace TI_BLE_HCI_ClientLib.HCICommands
{
    public class HCICommand_GAP_Device_Init : HCIVendorSpecificCommand
    {
        private const byte CMD = 0x0;

        public enum ProfileRoleEnum
        {
            GAPProfileBroadcaster = 1,
            GAPProfileObserver = 2,
            GAPProfilePeripheral = 4,
            GAPProfileCentral = 8
        }

        public enum Return_Status
        {
            Success = 0,
            InvalidParameter = 2
        }

        public HCICommand_GAP_Device_Init(ProfileRoleEnum profileRole, byte maxScanResponses, byte[] irk, byte[] csrk, uint signCounter)
            : base(HCIVendorSpecificCommandCSG.GAP, CMD)
        {
            var pars = new BaseEntityParameter[5];

            pars[0] = new ByteParameter((byte)profileRole);
            pars[1] = new ByteParameter(maxScanResponses);
            pars[2] = new ByteArrayParameter(irk);
            pars[3] = new ByteArrayParameter(csrk);
            pars[4] = new DoubleWordParameter(signCounter);

            base.addParameters(pars);
        }
    }
}